package edu.biwu.mapper;

import edu.biwu.po.OrderDetail;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 王俊彪
 * @version 1.0
 */
public interface OrderDetailMapper {
    /**
     * 根据订单id查询出订单明细
     * @param orderId
     * @return
     */
    @Results({
            @Result(column = "order_id",property = "orderId"),
            @Result(column = "product_id",property = "productId"),
            @Result(column = "product_num",property = "productNum")
    })
    @Select("SELECT * FROM mybatis03.order_detail WHERE order_id =#{orderId}")
    List<OrderDetail> findByOrderId(int orderId);
}
